package cn.edu.sgu.www.mhxysy.dto.repository;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class RoleRepositoryDTO implements DataTransferObject {

    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 仓库名字
     */
    @Pattern(regexp = "^.{1,4}$", message = "名字长度不能超过4个字")
    @ApiModelProperty(value = "仓库名字", required = true)
    private String name;

    /**
     * 角色ID
     */
    @Pattern(regexp = "^[1-4]\\d{5,8}$", message = "角色ID" + CustomMessages.ILLEGAL)
    @ApiModelProperty(value = "角色ID", required = true)
    private String roleId;

    /**
     * 仓库位置
     */
    @Range(min = 1, max = 25, message = "仓库位置" + CustomMessages.ILLEGAL)
    @Positive(message = "仓库位置" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "仓库位置", required = true)
    private Integer location;
}